#include "raylib.h"

int main(void)
{
    // 初始化窗口
    const int screenWidth = 2000;
    const int screenHeight = 1500;
    InitWindow(screenWidth, screenHeight, "raylib");

    // 加载纹理
    Texture2D texture = LoadTexture("assets/imgs/zou.png");
    
    // 加载颜色反转着色器
    Shader shader = LoadShader(0, "assets/shaders/invert.fs");

    // 主游戏循环
    SetTargetFPS(60);

    while (!WindowShouldClose())
    {
        // 绘制
        BeginDrawing();
            ClearBackground(RAYWHITE);
            
            // 原始纹理
            // DrawTexture(texture, 100, 150, WHITE);
            // DrawText("原始", 100, 120, 20, DARKGRAY);
            
            // 使用着色器的纹理
            BeginShaderMode(shader);
                DrawTexture(texture, 400, 150, WHITE);
            EndShaderMode();
            DrawText("颜色反转", 400, 120, 20, DARKGRAY);
            
            DrawText("颜色反转着色器示例", 10, 10, 30, DARKGRAY);
            DrawFPS(10, 50);
        EndDrawing();
    }

    // 清理资源
    UnloadShader(shader);
    UnloadTexture(texture);
    CloseWindow();

    return 0;
}